package com.fz.us.oa.core.entity.com;

import com.fz.us.admin.company.entity.BaseFlowEntity;
import com.fz.us.admin.company.entity.Department;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 业务实体类 - 资产采购登记表
 * ============================================================================
 * 版权所有 2017 。
 *
 * @author XuHeng
 * @version 1.0 2017-02-13 。
 * ============================================================================
 */
@Entity
@Table(name="ec_purchase")
public class Purchase extends BaseFlowEntity {

    private static final long serialVersionUID = 1589643702962134001L;

    /**
     * 申请部门
     */
    private Department issueDepartment;

    /**
     * 申请事由
     */
    private String applyReason;

    /**
     * 资产采购项目集合
     */
    private List<PurchaseItem> purchaseItems;

    //预算金额合计
    private double planMoneySum;

    //实际金额合计
    private double factMoneySum;

    /**
     * 其他需要说明情况
     */
    private String memo;

    /**
     * 提交日期
     */
    private Date dateApply;
    /**
     * 文档状态数值
     */
    private int numStatus;
    /**
     * 文档状态文字
     */
    private String txtStatus;

    /**
     * 表单名称
     */
    private String form;

    @Column(nullable=false, columnDefinition = "varchar(50) default '资产采购登记表'")
    public String getForm() {
        return form;
    }

    public void setForm(String form) {
        this.form = form;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public Department getIssueDepartment() {
        return issueDepartment;
    }

    public void setIssueDepartment(Department issueDepartment) {
        this.issueDepartment = issueDepartment;
    }

    public String getApplyReason() {
        return applyReason;
    }

    public void setApplyReason(String applyReason) {
        this.applyReason = applyReason;
    }

    @OneToMany(fetch = FetchType.LAZY)
    public List<PurchaseItem> getPurchaseItems() {
        return purchaseItems;
    }

    public void setPurchaseItems(List<PurchaseItem> purchaseItems) {
        this.purchaseItems = purchaseItems;
    }

    public double getPlanMoneySum() {
        return planMoneySum;
    }

    public void setPlanMoneySum(double planMoneySum) {
        this.planMoneySum = planMoneySum;
    }

    public double getFactMoneySum() {
        return factMoneySum;
    }

    public void setFactMoneySum(double factMoneySum) {
        this.factMoneySum = factMoneySum;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Date getDateApply() {
        return dateApply;
    }

    public void setDateApply(Date dateApply) {
        this.dateApply = dateApply;
    }

    public int getNumStatus() {
        return numStatus;
    }

    public void setNumStatus(int numStatus) {
        this.numStatus = numStatus;
    }

    public String getTxtStatus() {
        return txtStatus;
    }

    public void setTxtStatus(String txtStatus) {
        this.txtStatus = txtStatus;
    }
}
